<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    exclude-result-prefixes="">
    <xsl:output method="xml" indent="yes"/>
    <xsl:template match="//category">
        <resource>
        	<instance>
            	<xsl:apply-templates/>
            </instance>
        </resource>
    </xsl:template>
	
	<xsl:template match="text()|@*" />
	
    <xsl:template match="main">
        <subject>
            <xsl:value-of select="."/>
            <xsl:if test="following-sibling::sub">
             - <xsl:value-of select="following-sibling::sub" />
            </xsl:if>
        </subject>
    </xsl:template>

</xsl:stylesheet>
